Before removing outliers
ggplot(d, aes(ReactionTime, fill=Task)) +
geom_density(alpha = .5)
summary(d$ReactionTime)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 2 735 913 1111 1212 42181
Long tail justifies outlier removal?
ggplot(d, aes(LogReactionTime, fill=Task)) +
geom_density(alpha = .5)
summary(d$LogReactionTime)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 0.6931 6.5999 6.8167 6.8731 7.1000 10.6497
# Remove subjects with ReactionTime higher than 3x IQR
summary(d$LogReactionTime)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 0.6931 6.5999 6.8167 6.8731 7.1000 10.6497
# Min. 1st Qu. Median Mean 3rd Qu. Max.
# 6.924 7.328 7.436 7.479 7.579 10.008
range(d$LogReactionTime)
## [1] 0.6931472 10.6497252
hist(d$LogReactionTime, breaks=100, col="lightblue", xlab="LogReactionTime (ms)",
main="Histogram with Normal Curve")
quantile(d$LogReactionTime)
## 0% 25% 50% 75% 100%
## 0.6931472 6.5998705 6.8167359 7.1000272 10.6497252
IQR(d$LogReactionTime)*3 # 0.7526289
## [1] 1.50047
cutoff.high <- quantile(d$LogReactionTime)[4] + IQR(d$LogReactionTime)*3 # 8.419261
cutoff.low <- quantile(d$LogReactionTime)[2] - IQR(d$LogReactionTime)*3# 6.5088838.419261
# remove subjects with ReactionTime higher than 3 x IQR
df.outliers.removed <- subset(d, (d$LogReactionTime > cutoff.low) & (d$LogReactionTime < cutoff.high))
hist(df.outliers.removed$LogReactionTime, col="lightblue", xlab="LogReactionTime (ms)",
main="Histogram with Normal Curve")
agr = df.outliers.removed %>%
group_by(Task,LogReactionTime) %>%
summarize(MeanAccuracy = mean(Accuracy) )
## `summarise()` has grouped output by 'Task'. You can override using the
## `.groups` argument.
ggplot(agr, aes(x = MeanAccuracy, y = LogReactionTime, fill = MeanAccuracy)) +
geom_boxplot(alpha = 0.7) + # Boxplot
geom_jitter(position = position_jitter(0.2), color = "black", size = 1.5, alpha = 0.5) + # Add jittered points
facet_wrap(~Task) +
labs(title = "Reaction Time by Accuracy",
x = "Accuracy",
y = "Reaction Time (ms)") +
theme_minimal() +
theme(legend.position = "none") # Remove legend
## Warning: Continuous x aesthetic
## ℹ did you forget `aes(group = ...)`?
## Warning: The following aesthetics were dropped during statistical transformation: fill.
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
## the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
## variable into a factor?
## The following aesthetics were dropped during statistical transformation: fill.
## ℹ This can happen when ggplot fails to infer the correct grouping structure in
## the data.
## ℹ Did you forget to specify a `group` aesthetic or to convert a numerical
## variable into a factor?
ggplot(df.outliers.removed, aes(x = Accuracy, y = LogReactionTime, fill = Task)) +
geom_violin(alpha = 0.7) + # Violin plot
geom_jitter(position = position_jitter(0.2), color = "black", size = 1.5, alpha = 0.5) + # Add jittered points
labs(title = "Reaction Time by Accuracy",
x = "Accuracy",
y = "Reaction Time (ms)")
# theme_minimal() +
# theme(legend.position = "none") # Remove legend
agr <- df.outliers.removed %>%
group_by(Task) %>%
reframe(MeanAccuracy = mean(Accuracy),
CILow = ci.low(Accuracy),
CIHigh = ci.high(Accuracy)) %>%
mutate(YMin = MeanAccuracy - CILow,
YMax = MeanAccuracy + CIHigh)
# View(agr)
dodge = position_dodge(.9)
ggplot(data=agr, aes(x=Task,y=MeanAccuracy,fill=Task)) +
geom_bar(position=dodge,stat="identity") +
geom_errorbar(aes(ymin=YMin,ymax=YMax),width=.25,position=position_dodge(0.9))
# theme(axis.text.x = element_text(angle = 45, hjust = 1)) +
# guides(fill = "none")
agr <- df.outliers.removed %>%
# filter(PennElementType == "Selector") %>%
# select(ID.true,Word,Accuracy) %>%
group_by(Task,Word) %>%
mutate(MeanAccuracy = mean(Accuracy),
CILow = ci.low(Accuracy),
CIHigh = ci.high(Accuracy)) %>%
mutate(YMin = MeanAccuracy - CILow,
YMax = MeanAccuracy + CIHigh)
dodge = position_dodge(.9)
ggplot(data=agr, aes(x=Word,y=MeanAccuracy,fill=Task)) +
geom_bar(position=dodge,stat="identity") +
geom_errorbar(aes(ymin=YMin,ymax=YMax),width=.25,position=position_dodge(0.9)) +
theme(axis.text.x = element_text(angle = 45, hjust = 1)) +
guides(fill = "none")
# View(d[(d$ID.true == c("56cc78e3ccc0e20006b82a7d")) & (d$Word == c("envy")),])
Participants performed better when Concreteness task came first
agr <- df.outliers.removed %>%
# filter(PennElementType == "Selector") %>%
# select(ID.true,Word,Accuracy) %>%
group_by(BlockOrder,Word) %>%
mutate(MeanAccuracy = mean(Accuracy),
CILow = ci.low(Accuracy),
CIHigh = ci.high(Accuracy)) %>%
mutate(YMin = MeanAccuracy - CILow,
YMax = MeanAccuracy + CIHigh)
dodge = position_dodge(.9)
ggplot(data=agr, aes(x=Word,y=MeanAccuracy,fill=BlockOrder)) +
geom_bar(position=dodge,stat="identity") +
geom_errorbar(aes(ymin=YMin,ymax=YMax),width=.25,position=position_dodge(0.9)) +
theme(axis.text.x = element_text(angle = 45, hjust = 1))
# guides(fill = "none")
# View(d[(d$ID.true == c("56cc78e3ccc0e20006b82a7d")) & (d$Word == c("envy")),])
Participants performed better when Concreteness task came first
agr <- df.outliers.removed %>%
group_by(BlockOrder,Task,Word) %>%
mutate(MeanAccuracy = mean(Accuracy),
CILow = ci.low(Accuracy),
CIHigh = ci.high(Accuracy)) %>%
mutate(YMin = MeanAccuracy - CILow,
YMax = MeanAccuracy + CIHigh)
dodge = position_dodge(.9)
ggplot(data=agr, aes(x=Task,y=MeanAccuracy,fill=BlockOrder)) +
geom_bar(position=dodge,stat="identity") +
geom_errorbar(aes(ymin=YMin,ymax=YMax),width=.25,position=position_dodge(0.9)) +
facet_wrap(~Word,ncol=5)
# theme(axis.text.x = element_text(angle = 45, hjust = 1))
# guides(fill = "none")
# View(d[(d$ID.true == c("56cc78e3ccc0e20006b82a7d")) & (d$Word == c("envy")),])
agr = df.outliers.removed %>%
group_by(Task,Word) %>%
summarize(MeanLogReactionTime = mean(LogReactionTime),
CILow = ci.low(LogReactionTime),
CIHigh = ci.high(LogReactionTime)) %>%
mutate(YMin = MeanLogReactionTime - CILow,
YMax = MeanLogReactionTime + CIHigh)
## `summarise()` has grouped output by 'Task'. You can override using the
## `.groups` argument.
ggplot(agr, aes(x=MeanLogReactionTime, fill=Task)) +
geom_density(alpha = .4)
ggplot(agr, aes(x=Task, y=MeanLogReactionTime,fill=Task)) +
geom_violin(trim=FALSE,alpha=.4) +
geom_jitter(shape=16, position=position_jitter(0.2)) +
# geom_errorbar(aes(ymin=YMin,ymax=YMax),width=.25,position="dodge", show.legend = FALSE) +
# theme(axis.text.x = element_text(angle = 45, hjust = 1)) +
guides(fill = "none")
agr = df.outliers.removed %>%
group_by(Task,Word) %>%
summarize(MeanReactionTime = mean(ReactionTime),
CILow = ci.low(ReactionTime),
CIHigh = ci.high(ReactionTime)) %>%
mutate(YMin = MeanReactionTime - CILow,
YMax = MeanReactionTime + CIHigh)
## `summarise()` has grouped output by 'Task'. You can override using the
## `.groups` argument.
ggplot(agr, aes(x=MeanReactionTime, fill=Task)) +
geom_density(alpha = .4)
ggplot(agr, aes(x=Task, y=MeanReactionTime,fill=Task)) +
geom_violin(trim=FALSE,alpha=.4) +
geom_jitter(shape=16, position=position_jitter(0.2)) +
# geom_errorbar(aes(ymin=YMin,ymax=YMax),width=.25,position="dodge", show.legend = FALSE) +
# theme(axis.text.x = element_text(angle = 45, hjust = 1)) +
guides(fill = "none")
agr = df.outliers.removed %>%
group_by(BlockOrder,Task,Word) %>%
summarize(MeanLogReactionTime = mean(LogReactionTime),
CILow = ci.low(LogReactionTime),
CIHigh = ci.high(LogReactionTime)) %>%
mutate(YMin = MeanLogReactionTime - CILow,
YMax = MeanLogReactionTime + CIHigh)
## `summarise()` has grouped output by 'BlockOrder', 'Task'. You can override
## using the `.groups` argument.
ggplot(agr, aes(x=MeanLogReactionTime, fill=Task)) +
geom_density(alpha = .4)
ggplot(agr, aes(x=MeanLogReactionTime, fill=Task)) +
facet_wrap(~BlockOrder) +
geom_density(alpha = .4)
ggplot(agr, aes(x=Task, y=MeanLogReactionTime,fill=BlockOrder)) +
geom_violin(trim=FALSE,alpha=.4) +
geom_jitter(shape=16, position=position_jitter(0.2))
agr = df.outliers.removed %>%
group_by(BlockOrder,Task,Word) %>%
summarize(MeanReactionTime = mean(ReactionTime),
CILow = ci.low(ReactionTime),
CIHigh = ci.high(ReactionTime)) %>%
mutate(YMin = MeanReactionTime - CILow,
YMax = MeanReactionTime + CIHigh)
## `summarise()` has grouped output by 'BlockOrder', 'Task'. You can override
## using the `.groups` argument.
ggplot(agr, aes(x=MeanReactionTime, fill=Task)) +
geom_density(alpha = .4)
ggplot(agr, aes(x=MeanReactionTime, fill=Task)) +
facet_wrap(~BlockOrder) +
geom_density(alpha = .4)
ggplot(agr, aes(x=Task, y=MeanReactionTime,fill=BlockOrder)) +
geom_violin(trim=FALSE,alpha=.4) +
geom_jitter(shape=16, position=position_jitter(0.2))
agr = df.outliers.removed %>%
group_by(Task,Word) %>%
summarize(MeanReactionTime = mean(ReactionTime), CILow = ci.low(ReactionTime), CIHigh = ci.high(ReactionTime)) %>%
mutate(YMin = MeanReactionTime - CILow, YMax = MeanReactionTime + CIHigh)
## `summarise()` has grouped output by 'Task'. You can override using the
## `.groups` argument.
dodge = position_dodge(.9)
ggplot(data=agr, aes(x=Word,y=MeanReactionTime,fill=Task)) +
geom_bar(position=dodge,stat="identity") +
# facet_wrap(~Task) +
geom_errorbar(aes(ymin=YMin,ymax=YMax),width=.25,position=position_dodge(0.9)) +
theme(axis.text.x = element_text(angle = 45, hjust = 1))
# guides(fill = "none")
agr = df.outliers.removed %>%
group_by(BlockOrder,Task,Word) %>%
summarize(MeanReactionTime = mean(ReactionTime), CILow = ci.low(ReactionTime), CIHigh = ci.high(ReactionTime)) %>%
mutate(YMin = MeanReactionTime - CILow, YMax = MeanReactionTime + CIHigh)
## `summarise()` has grouped output by 'BlockOrder', 'Task'. You can override
## using the `.groups` argument.
dodge = position_dodge(.9)
ggplot(data=agr, aes(x=Task,y=MeanReactionTime,fill=BlockOrder)) +
geom_bar(position=dodge,stat="identity") +
facet_wrap(~Word) +
geom_errorbar(aes(ymin=YMin,ymax=YMax),width=.25,position=position_dodge(0.9)) +
theme(axis.text.x = element_text(angle = 45, hjust = 1))
# guides(fill = "none")
agr = df.outliers.removed %>%
group_by(Task,ConcValCombo) %>%
reframe(MeanReactionTime = mean(ReactionTime), CILow = ci.low(ReactionTime), CIHigh = ci.high(ReactionTime)) %>%
mutate(YMin = MeanReactionTime - CILow, YMax = MeanReactionTime + CIHigh)
dodge = position_dodge(.9)
ggplot(data=agr, aes(x=Task,y=MeanReactionTime,fill=ConcValCombo)) +
geom_bar(position=dodge,stat="identity") +
# facet_wrap(~Task) +
geom_errorbar(aes(ymin=YMin,ymax=YMax),width=.25,position=position_dodge(0.9)) +
theme(axis.text.x = element_text(angle = 45, hjust = 1))
# guides(fill = "none")
agr = df.outliers.removed %>%
group_by(BlockOrder,Task,ConcValCombo) %>%
reframe(MeanReactionTime = mean(ReactionTime), CILow = ci.low(ReactionTime), CIHigh = ci.high(ReactionTime)) %>%
mutate(YMin = MeanReactionTime - CILow, YMax = MeanReactionTime + CIHigh)
dodge = position_dodge(.9)
ggplot(data=agr, aes(x=Task,y=MeanReactionTime,fill=BlockOrder)) +
geom_bar(position=dodge,stat="identity") +
facet_wrap(~ConcValCombo) +
geom_errorbar(aes(ymin=YMin,ymax=YMax),width=.25,position=position_dodge(0.9)) +
theme(axis.text.x = element_text(angle = 45, hjust = 1))
# guides(fill = "none")